/*
 * Copyright (c) 2012 Keerthi Ramachandran .
 */

package com.kee.example.domain;

import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

/**
 * Created with IntelliJ IDEA.
 * User: keerthi
 * Date: 12/8/12  6:57 PM
 */
public class Person {
    private long id;
    private String firstName;
    private String lastName;
    private Set events = new HashSet();
    private Set emailAddress = new HashSet();
    private Contact weekDayContact;
    private Contact holidayContact;

    public Person() {
    }

    public long getId() {
        return id;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public Set getEvents() {
        return events;
    }

    public void setId(long id) {
        this.id = id;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public void setEvents(Set events) {
        this.events = events;
    }

    public Set getEmailAddress() {
        return emailAddress;
    }

    public void setEmailAddress(Set inEmailAddress) {
        emailAddress = inEmailAddress;
    }

    public Contact getWeekDayContact() {
        return weekDayContact;
    }

    public void setWeekDayContact(Contact inWeekDayContact) {
        weekDayContact = inWeekDayContact;
    }

    public Contact getHolidayContact() {
        return holidayContact;
    }

    public void setHolidayContact(Contact inHolidayContact) {
        holidayContact = inHolidayContact;
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(this.id).append(this.firstName).append(this.lastName).toHashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Person other = (Person) obj;
        return new EqualsBuilder().append(this.id, other.id).append(this.firstName, other.firstName).append(this.lastName, other.lastName).isEquals();
    }
}
